<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>后台管理 | {$com.abbreviation}</title>
	<link rel="stylesheet" type="text/css" href="__APP____PUBLIC__/css/admin/style.css" />
	<link href="__APP____PUBLIC__/images/favicon.ico" type="image/ico" rel="shortcut icon">
	<script type="text/javascript" src="__APP____PUBLIC__/js/jquery-1.4.4.js"></script>
	<script type="text/javascript" src="__APP____PUBLIC__/admin/js/common.js"></script>
	<script>
	 function encodingForm(){
		 document.getElementById("productName").value = encodeURIComponent(document.getElementById("productName1").value);
	 }

	 function sort(id,sortVal){
		
			 	$.ajax({
				  url: '__URL__/sortUp',
				  data: {'id': id,'sortVal':sortVal},
				  success: function(data) {
				   	if(data!="success"){
					   	alert("修改排行失败");
				   	}
				  }
				});
				
           
			
		}
	</script>
</head>

<body>
	
		<include file="./Tpl/default/Admin/nav.html" />
		
		<div id="wrapper">
			<div id="nav_trail"><a href="__APP__/Admin/">管理首页</a></div>
			<div id="content">
				<!-- 左边菜单 -->
				<include file="./Tpl/default/Admin/left_menu.html" />
				<!-- 左边菜单 -->
			
				
				
				<script>
		menusel('house');
	</script>
	
	
				<div class="right_area">
					<div class="cbar">
			            
			              <ul>
			                <li class="cbar-tag-sel"><a href="__URL__/index">新房查询</a></li>
			    			<li><a href="__URL__/add">添加新房源</a></li>
			              </ul>
			         </div><!-- cbar end -->
			         
			         <div class="cbox">
          <form action="__URL__/index" method="get" name="form1" onsubmit="encodingForm()">
            <div class="ydbar">
              <div class="info-title">快速检索</div>
            </div>
            <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table-f">
              <tbody>
              <tr>
                <td width="10%" align="right" class="formtdl">使用面积：</td>
                <td width="40%"><select name="useArea">
						<option value="0">不限</option>                   
		                   <foreach name='areaArr' item="area">
								<option value="{$area}" <if condition="$useArea eq $area">selected=selected</if> >{$key}</option>
				           </foreach>
                    </select>
                </td>
               
               <td width="10%" align="right" class="formtdl">价格：</td>
                <td width="40%"><select name="totalPrice" id="price">
						<option value="0">不限</option>
		                   <foreach name='priceArr' item="price">
		                   
								<option value="{$price}" <if condition="$totalPrice eq $price">selected=selected</if> >{$key}</option>
				           </foreach>
		              </select>
                </td>
              </tr>
              <tr>
                <td width="10%" align="right" class="formtdl">户型：</td>
                <td width="40%"><select name="houseType" >
                			<option value="0">不限</option>
							<foreach name='houseTypeArr' item="htype">
								<option value="{$htype}" <if condition="$houseType eq $htype">selected=selected</if> >{$key}</option>
				           </foreach>
                    </select>
                </td>
               
               <td width="10%" align="right" class="formtdl">区域：</td>
                <td width="40%"><select name="districtID"  id="sprice">
                	<option value="0">不限</option>
                	<foreach name='distList' item="dist">
						<option value="{$dist.id}" <eq name="dist['id']" value="$districtID" >selected=selected</eq> >{$dist.name}</option>
		              
		           </foreach>
		           </select>
                </td>
              </tr>
              <tr>
                <td align="right" class="formtdl">房源名称：</td>
                <td>
                	<input type="hidden" name="productName" id="productName" size="35" value="{$productName}" />
                	<input type="text" id="productName1" size="30" value="{$productName}" /> </td>
                <td align="right" class="formtdl">房源类型：</td>
                <td><select name="type" size="1" id="sprice">
                		<option value="0">不限</option>
						<option value="1" <if condition="$type eq 1">selected=selected</if> >新房</option>
						<option value="2" <if condition="$type eq 2">selected=selected</if> >二手房</option>
		            </select>
		        </td>
              </tr>
             
            </tbody></table>
            <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table-x">
              <tbody><tr>
                <td>
                    <div class="c-col-r btn-add">
                      <div class="btn-add-l"></div>
                      <h4><center><input type="submit" value="查询" class="inp-yd"></center></h4>
                      <div class="btn-add-r"></div>
                    </div>
                    </td>
              </tr>
            </tbody></table>
            </form>
            <div class="ydbar">
      			<div class="info-title">房源列表</div>
    		</div>	
            <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" class="table_b">
              <tbody><tr class="tab-top">
                <td align="center" width="10%"><strong>房源编号</strong></td>
                <td align="center" width="15%"><strong>房源名称</strong></td>
                <td align="center" width="10%"><strong>区域</strong></td>
                <td align="center" width="10%"><strong>面积</strong></td>
                <td align="center" width="15%"><strong>房型</strong></td>
                <td align="center" width="15%"><strong>售价</strong></td>
                <td align="center" width="10%"><strong>单价/平方</strong></td>
                <td align="center" width="5%" title="输入序号后点击一下输入框旁边的其它地方即可修改"><strong>排序</strong></td>
                <td align="center" width="10%"><strong>操作</strong></td>
              </tr>              
               
               
               <volist name="houseList" id="house">
               
              <tr onmouseout="this.className=&quot;table-d-c&quot;" onmouseover="this.className=&quot;td-m&quot;" class="table-d-c">
				<td align="center">{$house.id}</td>
                <td align="center"><a target="_blank" href="__APP__/house/view?id={$house.id}">{$house.productName}</a></td>
                <td align="center">
                	<foreach name='distList' item="dist">
                		<eq name="house['districtID']" value="$dist.id" >{$dist.name}</eq>
                	</foreach>
                </td>
                <td align="center">{$house.useArea|number_format=0}㎡</td>
                <td align="center">
                	<foreach name='houseTypeArr' item="type">
                		<eq name="house['houseType']" value="$type" >{$key}</eq>
                	</foreach>
                </td> 
                <td align="center">{$house.totalPrice|number_format=0}万</td>
                <td align="center">{$house.unitPrice|number_format=0}</td>
                <td align="center"><input type="text" name="sort" value="{$house.sort}" onblur="sort('{$house.id}',this.value)" size=2/></td>
                <td align="center"><a href="__URL__/edit?id={$house.id}">编辑</a> |
                 <a onclick="return confirm( '是否需要删除? ');" href="__URL__/delete?id={$house.id}">删除</a>
                </td>
              </tr>
              </volist>
             
			  <tr><td colspan=8 align="center">{$page}</td></tr>
            </tbody></table>
            

          </div><!-- cbox end -->
            
			            
			        </div><!-- right_area end -->
				</div>
				
				<div class="clear"></div>
			</div> <!-- content end-->
			<div id="footer"></div>
   		</div><!-- wrapper end-->
</body>
</html>